
<!DOCTYPE html>
<html>
<head lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>骡窝窝问答,解决旅行问题,基于旅游的问答分享平台 - 骡窝窝</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover">
    <meta name="copyright" content="Copyright (c) 2006-2018 Luowogwo.">
    <meta name="format-detection" content="telephone=no,address=no">
    <meta name="referrer" content="always">
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta name="apple-mobile-web-app-status-bar-style" content="no">
    <link href="/css/question/mobile+css+head_mobile+css+ui^yvw^1526627473.css"
          rel="stylesheet" type="text/css">
    <link href="/css/question/new_ask2016.css" rel="stylesheet" type="text/css">

    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/plugins/form/jquery.form.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>

</head>

<script>
    $(function () {
        var currentPage = 1;//当前页
        var pages;//总页数
        var questionData=[];//定义一个数组用来接收每次分页时的数据
        function query() {//记得传递当前页这个参数
            $.get("/questions",{currentPage:currentPage},function (data) {
                $.merge(questionData,data.list);
                var json = {
                    list: questionData
                };
                $("#question").renderValues(json,{
                    getHref:function (item,value) {
                        var url = $(item).data("href");
                        $(item).attr("href",url+value);
                    },
                    getUserHref:function (item,value) {
                        var url = $(item).data("href");
                        $(item).attr("href",url+value);
                    }
                });
                pages = data.pages;
            });
            currentPage ++;
        }
        //默认查询第一页
        query();
        //点击查看更多时查询第二页
        $("#moreQuestion").click(function () {
            if (currentPage <= pages){//如果当前页数小于等于总页数
                query();
            }else {
                $(document).dialog({
                    type : 'notice',
                    content: '<span class="info-text">没有更多问题了!</span>',
                    autoClose: 1000,
                    position: 'bottom'
                });
            }
        });
    });
</script>
<body>
<div id="pos38"></div>
<header class="MfwHead ">
    <div class="LBtn">
        <a class="btn back" href="/index.html" id="_j_top_history_back">
            <span><i class="fa fa-chevron-left fa-2x"></i></span>
        </a>
    </div>
    <div class="CBtn">
        <h1>骡窝窝问答</h1>
    </div>
    <div class="RBtn">
    </div>
</header>
<div>
    <img src="/img/61ca44c3002ac2dbd2e04c46826cc4cc.jpg" style="width: 100%">
</div>
<section class="ans-list a-list">
    <ul class="_j_pager_box">
        <div id="question">
            <div render-loop="list">
                <li>
                    <a data-href="/questionDetail.html?id=" render-fun="getHref" render-key="list.id">
                        <h2 render-html="list.title"></h2>
                    </a>
                    <div class="clearfix">
                        <div class="rol">
                            <p>
                                <a data-href="/userProfiles.html?id=" render-key="list.user.id" render-fun="getUserHref">
                                    <img style="border-radius: 30px"  render-src="list.user.headImgUrl" width="30px">
                                    <span render-html="list.user.nickName"></span>
                                </a>
                            </p>
                        </div>
                        <div class="ans-nr">
                            <a data-href="/questionDetail.html?id=" render-fun="getHref" render-key="list.id">
                                <div class="clearfix">
                                    <div class="pic">
                                        <img render-src="list.questionImg" width="80px">
                                    </div>
                                    <p render-html="list.content"></p>
                                </div>
                                <div class="clearfix">
                                    <span class="fl-l" render-html="list.placeName"></span>
                                    <span class="fl-r">
                                                <span render-html="list.creatTime"></span>
                                            </span>
                                </div>
                            </a>
                        </div>
                    </div>
                    </a>
                </li>
            </div>
        </div>
    </ul>
    <div style="margin-bottom: 65px;" id="moreQuestion">
        <a class="more-list _j_add_more_button">更多问题</a>
    </div>
</section>

<section class="askfoot">
    <a href="/mine/askQuestion.html" class="btn-que" data-cs-p="show_publish"><i></i>
        我要提问
    </a>
</section>
</body>
</html>